from __future__ import absolute_import, unicode_literals
import os

import time
from celery import Celery

#1,加载环境变量
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meiduo.settings")

#2,创建celery对象
app = Celery('my_meiduo')

#3,加载配置项
app.config_from_object('celery_tasks.config', namespace='CELERY')

#4,注册任务,格式: celery_tasks.包名
# app.autodiscover_tasks(['celery_tasks.sms'],'[celery_tasks.email]','[celery_tasks.html]')
app.autodiscover_tasks(['celery_tasks.sms','celery_tasks.email]','celery_tasks.html'])

